for %z mb mbf mbcond mbfcond
for %y vw ew vw5 ew5
read(t=xls, s={%z}{%y}, c2) 2018.xls 25

table(7,10) alpha63_{%z}{%y}
setcell(alpha63_{%z}{%y},1,2,"Low")
setcell(alpha63_{%z}{%y},1,3,"IVol2")
setcell(alpha63_{%z}{%y},1,4,"IVol3")
setcell(alpha63_{%z}{%y},1,5,"IVol4")
setcell(alpha63_{%z}{%y},1,6,"High")
setcell(alpha63_{%z}{%y},1,7,"L-H")
setcell(alpha63_{%z}{%y},2,1,"Value")
setcell(alpha63_{%z}{%y},3,1,"t-stat")
setcell(alpha63_{%z}{%y},4,1,"MB2")
setcell(alpha63_{%z}{%y},5,1,"t-stat")
setcell(alpha63_{%z}{%y},6,1,"MB3")
setcell(alpha63_{%z}{%y},7,1,"t-stat")
setcell(alpha63_{%z}{%y},8,1,"MB4")
setcell(alpha63_{%z}{%y},9,1,"t-stat")
setcell(alpha63_{%z}{%y},10,1,"Growth")
setcell(alpha63_{%z}{%y},11,1,"t-stat")
setcell(alpha63_{%z}{%y},12,1,"V-G")
setcell(alpha63_{%z}{%y},13,1,"t(V-G)")

for !i=1 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt
setcell(alpha63_{%z}{%y},2*!i,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alpha63_{%z}{%y},2*!i+1,!j+1,eq{!i}{!j}.@tstats(1))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt
setcell(alpha63_{%z}{%y},2*!i,7,eq{!i}.@coefs(1))
setcell(alpha63_{%z}{%y},2*!i+1,7,eq{!i}.@tstats(1))
equation equ{!j}.ls(n) (port{!j}1-port{!j}5) c mkt
setcell(alpha63_{%z}{%y},12,!j+1,equ{!j}.@coefs(1))
setcell(alpha63_{%z}{%y},13,!j+1,equ{!j}.@tstats(1))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) -(port11-port51-port15+port55) c mkt
setcell(alpha63_{%z}{%y},12,7,eq.@coefs(1))
setcell(alpha63_{%z}{%y},13,7,eq.@tstats(1))
delete eq

table(7,10) alpha86_{%z}{%y}
setcell(alpha86_{%z}{%y},1,2,"Low")
setcell(alpha86_{%z}{%y},1,3,"IVol2")
setcell(alpha86_{%z}{%y},1,4,"IVol3")
setcell(alpha86_{%z}{%y},1,5,"IVol4")
setcell(alpha86_{%z}{%y},1,6,"High")
setcell(alpha86_{%z}{%y},1,7,"L-H")
setcell(alpha86_{%z}{%y},2,1,"Value")
setcell(alpha86_{%z}{%y},3,1,"t-stat")
setcell(alpha86_{%z}{%y},4,1,"MB2")
setcell(alpha86_{%z}{%y},5,1,"t-stat")
setcell(alpha86_{%z}{%y},6,1,"MB3")
setcell(alpha86_{%z}{%y},7,1,"t-stat")
setcell(alpha86_{%z}{%y},8,1,"MB4")
setcell(alpha86_{%z}{%y},9,1,"t-stat")
setcell(alpha86_{%z}{%y},10,1,"Growth")
setcell(alpha86_{%z}{%y},11,1,"t-stat")
setcell(alpha86_{%z}{%y},12,1,"V-G")
setcell(alpha86_{%z}{%y},13,1,"t(V-G)")

smpl if fvix5<>na
for !i=1 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt
setcell(alpha86_{%z}{%y},2*!i,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alpha86_{%z}{%y},2*!i+1,!j+1,eq{!i}{!j}.@tstats(1))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt
setcell(alpha86_{%z}{%y},2*!i,7,eq{!i}.@coefs(1))
setcell(alpha86_{%z}{%y},2*!i+1,7,eq{!i}.@tstats(1))
equation equ{!j}.ls(n) (port{!j}1-port{!j}5) c mkt
setcell(alpha86_{%z}{%y},12,!j+1,equ{!j}.@coefs(1))
setcell(alpha86_{%z}{%y},13,!j+1,equ{!j}.@tstats(1))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) -(port11-port51-port15+port55) c mkt
setcell(alpha86_{%z}{%y},12,7,eq.@coefs(1))
setcell(alpha86_{%z}{%y},13,7,eq.@tstats(1))
delete eq

table(7,10) alphaicapm_{%z}{%y}
setcell(alphaicapm_{%z}{%y},1,2,"Low")
setcell(alphaicapm_{%z}{%y},1,3,"IVol2")
setcell(alphaicapm_{%z}{%y},1,4,"IVol3")
setcell(alphaicapm_{%z}{%y},1,5,"IVol4")
setcell(alphaicapm_{%z}{%y},1,6,"High")
setcell(alphaicapm_{%z}{%y},1,7,"L-H")
setcell(alphaicapm_{%z}{%y},2,1,"Value")
setcell(alphaicapm_{%z}{%y},3,1,"t-stat")
setcell(alphaicapm_{%z}{%y},4,1,"MB2")
setcell(alphaicapm_{%z}{%y},5,1,"t-stat")
setcell(alphaicapm_{%z}{%y},6,1,"MB3")
setcell(alphaicapm_{%z}{%y},7,1,"t-stat")
setcell(alphaicapm_{%z}{%y},8,1,"MB4")
setcell(alphaicapm_{%z}{%y},9,1,"t-stat")
setcell(alphaicapm_{%z}{%y},10,1,"Growth")
setcell(alphaicapm_{%z}{%y},11,1,"t-stat")
setcell(alphaicapm_{%z}{%y},12,1,"V-G")
setcell(alphaicapm_{%z}{%y},13,1,"t(V-G)")

table(7,10) betafivol_{%z}{%y}
setcell(betafivol_{%z}{%y},1,2,"Low")
setcell(betafivol_{%z}{%y},1,3,"IVol2")
setcell(betafivol_{%z}{%y},1,4,"IVol3")
setcell(betafivol_{%z}{%y},1,5,"IVol4")
setcell(betafivol_{%z}{%y},1,6,"High")
setcell(betafivol_{%z}{%y},1,7,"L-H")
setcell(betafivol_{%z}{%y},2,1,"Value")
setcell(betafivol_{%z}{%y},3,1,"t-stat")
setcell(betafivol_{%z}{%y},4,1,"MB2")
setcell(betafivol_{%z}{%y},5,1,"t-stat")
setcell(betafivol_{%z}{%y},6,1,"MB3")
setcell(betafivol_{%z}{%y},7,1,"t-stat")
setcell(betafivol_{%z}{%y},8,1,"MB4")
setcell(betafivol_{%z}{%y},9,1,"t-stat")
setcell(betafivol_{%z}{%y},10,1,"Growth")
setcell(betafivol_{%z}{%y},11,1,"t-stat")
setcell(betafivol_{%z}{%y},12,1,"V-G")
setcell(betafivol_{%z}{%y},13,1,"t(V-G)")

table(7,10) betafvix_{%z}{%y}
setcell(betafvix_{%z}{%y},1,2,"Low")
setcell(betafvix_{%z}{%y},1,3,"IVol2")
setcell(betafvix_{%z}{%y},1,4,"IVol3")
setcell(betafvix_{%z}{%y},1,5,"IVol4")
setcell(betafvix_{%z}{%y},1,6,"High")
setcell(betafvix_{%z}{%y},1,7,"L-H")
setcell(betafvix_{%z}{%y},2,1,"Value")
setcell(betafvix_{%z}{%y},3,1,"t-stat")
setcell(betafvix_{%z}{%y},4,1,"MB2")
setcell(betafvix_{%z}{%y},5,1,"t-stat")
setcell(betafvix_{%z}{%y},6,1,"MB3")
setcell(betafvix_{%z}{%y},7,1,"t-stat")
setcell(betafvix_{%z}{%y},8,1,"MB4")
setcell(betafvix_{%z}{%y},9,1,"t-stat")
setcell(betafvix_{%z}{%y},10,1,"Growth")
setcell(betafvix_{%z}{%y},11,1,"t-stat")
setcell(betafvix_{%z}{%y},12,1,"V-G")
setcell(betafvix_{%z}{%y},13,1,"t(V-G)")

smpl @all
for !i=1 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt fvix5 fdmivol11ew
setcell(alphaicapm_{%z}{%y},2*!i,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alphaicapm_{%z}{%y},2*!i+1,!j+1,eq{!i}{!j}.@tstats(1))
setcell(betafvix_{%z}{%y},2*!i,!j+1,eq{!i}{!j}.@coefs(3))
setcell(betafvix_{%z}{%y},2*!i+1,!j+1,eq{!i}{!j}.@tstats(3))
setcell(betafivol_{%z}{%y},2*!i,!j+1,eq{!i}{!j}.@coefs(4))
setcell(betafivol_{%z}{%y},2*!i+1,!j+1,eq{!i}{!j}.@tstats(4))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt fvix5 fdmivol11ew
setcell(alphaicapm_{%z}{%y},2*!i,7,eq{!i}.@coefs(1))
setcell(alphaicapm_{%z}{%y},2*!i+1,7,eq{!i}.@tstats(1))
setcell(betafvix_{%z}{%y},2*!i,7,eq{!i}.@coefs(3))
setcell(betafvix_{%z}{%y},2*!i+1,7,eq{!i}.@tstats(3))
setcell(betafivol_{%z}{%y},2*!i,7,eq{!i}.@coefs(4))
setcell(betafivol_{%z}{%y},2*!i+1,7,eq{!i}.@tstats(4))
equation equ{!j}.ls(n) (port{!j}1-port{!j}5) c mkt fvix5 fdmivol11ew
setcell(alphaicapm_{%z}{%y},12,!j+1,equ{!j}.@coefs(1))
setcell(alphaicapm_{%z}{%y},13,!j+1,equ{!j}.@tstats(1))
setcell(betafvix_{%z}{%y},12,!j+1,equ{!j}.@coefs(3))
setcell(betafvix_{%z}{%y},13,!j+1,equ{!j}.@tstats(3))
setcell(betafivol_{%z}{%y},12,!j+1,equ{!j}.@coefs(4))
setcell(betafivol_{%z}{%y},13,!j+1,equ{!j}.@tstats(4))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) -(port11-port51-port15+port55) c mkt fvix5 fdmivol11ew
setcell(alphaicapm_{%z}{%y},12,7,eq.@coefs(1))
setcell(alphaicapm_{%z}{%y},13,7,eq.@tstats(1))
setcell(betafvix_{%z}{%y},12,7,eq.@coefs(3))
setcell(betafvix_{%z}{%y},13,7,eq.@tstats(3))
setcell(betafivol_{%z}{%y},12,7,eq.@coefs(4))
setcell(betafivol_{%z}{%y},13,7,eq.@tstats(4))
delete eq

for !i=1 to 5
for !j=1 to 5
delete port{!i}{!j}
next
next

next
next

